<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>发布信息</title>
    <link rel="stylesheet" type="text/css" href="${applicationScope.basePath}/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="${applicationScope.basePath}/css/nav.css">
    <link rel="stylesheet" type="text/css" href="${applicationScope.basePath}/css/comments.css">
    <link href="${applicationScope.basePath}/css/font-awesome.css" rel="stylesheet"/>
    <script type="text/javascript" src="${applicationScope.basePath}/js/jquery-3.4.1.min.js"></script>
</head>
<body>
<jsp:include page="header.jsp" flush="true"/>
<div class="row" style="height: 100%;margin-top: -21px;">
    <div class="col-xs-2" style="height: 100%;margin-left: 0;">
        <div class="nav nav-pills nav-stacked">
            <div class="nav-top">
                <div id="mini" style="border-bottom:1px solid rgba(255,255,255,.1)"><img src="${applicationScope.basePath}/images/mini.png"></div>
            </div>
            <ul>
                <li class="nav-item"><a style="text-decoration: none;" href="${applicationScope.basePath}/admin/main"><i
                        class="icon icon-home"></i><span>首页</span></a></li>
                <li class="nav-item">
                    <a style="text-decoration: none;" href="javascript:;"><i
                            class="icon icon-group"></i><span>用户管理</span></a>
                    <ul>
                        <li><a style="text-decoration: none;" href="${applicationScope.basePath}/admin/userpage/1"><span>&emsp;&emsp;用户列表</span></a></li>
                    </ul>
                </li>
                <li class="nav-item">
                    <a style="text-decoration: none;" href="javascript:;"><i
                            class="icon icon-signal"></i><span>商品管理</span> </a>
                    <ul>
                        <li><a style="text-decoration: none;" href="${applicationScope.basePath}/admin/goodspage/1"><span>&emsp;&emsp;商品列表</span></a></li>
                    </ul>
                </li>
                <li class="nav-item">
                    <a style="text-decoration: none;" href="javascript:;"><i class="icon icon-th"></i><span>订单管理</span></a>
                    <ul>
                        <li><a style="text-decoration: none;" href="${applicationScope.basePath}/admin/orderspage/1"><span>&emsp;&emsp;订单列表</span></a></li>
                    </ul>
                </li>
                <li class="nav-item">
                    <a style="text-decoration: none;" href="javascript:;"><i
                            class="icon icon-inbox"></i><span>钱包管理</span></a>
                    <ul>
                        <li><a style="text-decoration: none;" href="${applicationScope.basePath}/admin/purse/page/1"><span>&emsp;&emsp;钱包列表</span></a></li>
                        <li><a style="text-decoration: none;" href="${applicationScope.basePath}/admin/withdrawals/page/1"><span>&emsp;&emsp;提现列表</span></a></li>
                        <li><a style="text-decoration: none;" href="${applicationScope.basePath}/admin/recharge/page/1"><span>&emsp;&emsp;充值列表</span></a></li>
                    </ul>
                </li>
                <li class="nav-item">
                    <a style="text-decoration: none;" href="javascript:;"><i
                            class="icon icon-fullscreen"></i><span>系统设置</span></a>
                    <ul>
                        <li><a style="text-decoration: none;" href="${applicationScope.basePath}/admin/sys"><span>&emsp;&emsp;发布信息</span></a></li>
                        <li><a style="text-decoration: none;" href="${applicationScope.basePath}/admin/password"><span>&emsp;&emsp;修改密码</span></a></li>
                        <li><a style="text-decoration: none;" href="${applicationScope.basePath}/admin/ipblack"><span>&emsp;&emsp;黑名单IP</span></a></li>
                    </ul>
                </li>
            </ul>
        </div>
    </div>
    <div class="col-xs-10 text-center" style="margin-top: 80px;">
        <form id="ajax-contact" action="#">
            <div class="form-group"><input type="text" class="form-control" id="subject" name="title"
                                           placeholder="标题"></div>
            <div class="form-group"><textarea class="form-control" id="message" name="message" rows="10"
                                              placeholder="内容*" required=""></textarea></div>
            <button class="btn btn-primary" type="submit" id="subMsg">提 交</button>
            <div id="form-messages"></div>
        </form>
    </div>
</div>
<script type="text/javascript" src="${applicationScope.basePath}/js/bootstrap.min.js"></script>
<script type="text/javascript" src="${applicationScope.basePath}/js/jquery.serializejson.js"></script>
<script type="text/javascript" src="${applicationScope.basePath}/js/nav.js"></script>

<script type="text/javascript">
    $(function () {
        $("#ajax-contact").submit(function (encodedURIComponent) {
            $("#subMsg").button('loading');
            let data = JSON.stringify($("#ajax-contact").serializeJSON());
            $.ajax({
                url: "${applicationScope.basePath}/admin/sys",
                type: "POST",
                dataType: "json",
                contentType: "application/json;charset=UTF-8",
                data: data,
                success: function (data) {
                    $("#subMsg").button('reset');
                    alert(data.errorMsg);
                },
                error: function (data) {
                    //跳转到错误页面
                }
            });
            return false;
        });
    })
</script>
</body>
</html>
